/**
 * 作用域和闭包
 */

let arr = []
for (let i = 0; i < 10; i++) {
    (function (a){
        console.log(a)
        arr.push(() => a)
    })(i)
}

console.log(arr)


let brr = []
for (var i = 0; i < 10; i++) {
    brr.push(() => i)
}
console.log(brr)

